module.exports = app => {
  const mongoose = app.mongoose;
  const Schema = mongoose.Schema;
  const VideoSchema = new Schema({
    title: {
      type: String,
      require: true,
    },
    descrption: {
      type: String,
      require: false,
    },
    vodvideId: {
      type: String,
      require: true,
    },
    user: {
      type: mongoose.ObjectId,
      require: true,
      ref: 'User',
    },
    cover: {
      type: String,
      require: false,
    },
    commentCount: {
      type: Number,
      default: 0,
    },
    likeCount: {
      type: Number,
      default: 0,
    },
    dislikeCount: {
      type: Number,
      default: 0,
    },
  });
  return mongoose.model('Video', VideoSchema);
};
